Re: authentication problems-- success!

Поиск
Список
Период
Сортировка
От Russ McBride
Тема Re: authentication problems-- success!
Дата
Msg-id v04210105b7ddbbb172b9@[64.164.9.154]
обсуждение исходный текст
Ответ на Re: authentication problems  ("Nick Fankhauser" <nickf@ontko.com>)
Ответы Re: authentication problems-- success!  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Hi guys,

>When you specify the database URL in your java code, try explicitly naming
>either localhost or 127.0.0.1.

Thanks for all the time you guys spent thinking about this
authentication problem and writing me.  I changed the URL in the java
code from 'localhost' to '127.0.0.1' and it worked fine (duh).

I also discovered the following interesting fact further showing that
the problem is OS-specific and has nothing to do with the way
postgreSQL is functioning.  On my Mac 10.03-os machine, it makes no
difference what my network settings are, whether my ports are active,
etc.  When I connect to a pg database locally, it goes fine.  On my
Mac 10.1-os machine, however, when I try to make a connection to
localhost it advertises my IP to postgresql as the first of whatever
active port settings I happen to have active at that time.  Only if I
switch off all ports does my IP get advertised as '127.0.0.1'.
Shouldn't specifying 'localhost' always force *my* IP to be broadcast
as 127.0.0.1 (or whatever 'localhost' may have been changed to in
/etc/hosts) regardless of what other network stuff is going on?  This
problem still remains a mystery to me, but at least I know what my
new os is doing, if not why, or how to fix what it's doing.

What started off as a "quick" check to make sure that pg worked on
10.1 as well as 10.0.x versions before completing my installation
documentation turned into a full on adventure, ending with this
authentication challenge.  I'm looking forward to getting some of the
actual work done now.

If anyone needs help with their Mac OS X installation send me an
e-mail.  I think we've got it pretty well figured out now . . .

Best,

Russ


>
>
>Supposedly, JDBC always defaults to localhost if a host is not specified,
>but from what we've learned so far, psql seems to have no problem if you
>explicitly point it to localhost using an IP connection, whereas JDBC
>doesn't connect when left to take the implicit default.
>
>So try either "jdbc:postgresql://localhost/testdb" or
>"jdbc:postgresql://127.0.0.1/testdb" & see what happens.
>
>If either works, you have at least achieved your goal of a stable local JDBC
>connection that doesn't depend on the actual IP address of the local
>machine. You'll also have one more clue to ponder if you can't sleep nights
>without knowing *why* the default isn't working as expected.
>
>You mentioned at the start of this thread that it works fine for you an a
>different machine- is the working machine also running Mac OS 10.1?
>
>-Nick
>---------------------------------------------------------------------
>Nick Fankhauser
>
>    nickf@doxpop.com  Phone 1.765.965.7363  Fax 1.765.962.9788
>doxpop - Court records at your fingertips - http://www.doxpop.com/
>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: authentication problems
Следующее
От: Manuel Trujillo
Дата:
Сообщение: Re: about the time of a process